import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class FinancePutDetailService {

  // 入库明细
  public find_URL = '/warehousing/find'

  // 入库导出
  public findExcel_URL = '/warehousing/findExcel'

  // 获取供应商列表
  public supplier_URL = '/supplier/list';

  constructor(public httpClient: HttpClient) { }
  /**
   * 入库明细列表
   * @params params 参数
   */
  public async findList(params: any) {
    return await this.httpClient.post(this.find_URL, params).toPromise();
  }
  /**
   * 入库导出
   * @params params 参数
   */
  public export(params?: any) {
    return this.httpClient.get(this.findExcel_URL, { params: params, responseType: 'blob' }).toPromise();
  }

  // 获取供应商列表
  public async getSupplierList(params?: any) {
    return await this.httpClient.post(this.supplier_URL, params).toPromise();
  }
}

